Component({
    properties: {
        maxNum: {
            type: Number,
            value: 6
        },
        cancelColor: String,
        cancelText: {
            type: String,
            value: "取消"
        }
    },
    data: {
        shown: !1,
        itemList: []
    },
    methods: {
        _onClick: function(t) {
            var e = t.currentTarget.dataset.index, n = this.data, i = n.shown, a = n.itemList;
            if (i) {
                var s = a[e].onClick;
                "function" == typeof s && s.call(this, e), this._onCancel(), this.triggerEvent("click", {
                    index: e
                }, {});
            }
        },
        show: function(t) {
            this.setData({
                itemList: t,
                shown: !0
            });
        },
        _onCancel: function() {
            this.setData({
                shown: !1
            });
        }
    }
});